import 'polyfill-object.fromentries'
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { RouteLocationNormalized, NavigationGuardNext } from 'vue-router'
import piniaStore from './store'
import i18n from './locale'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import './index.css'
import 'ant-design-vue/dist/reset.css'
// Support SVG
import 'virtual:svg-icons-register'

router.beforeEach(
  (to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext) => {
    // The page loading progress bar style plugin is enabled
    NProgress.start()
    next()
  },
)

router.afterEach(() => {
  NProgress.done()
})

createApp(App).use(router).use(piniaStore).use(i18n).mount('#app')
